The data look like a Gamma, so we model with Gamma and a log link (see above answer for reason). It might be nice
Ideally, I could run a distributional test and confirm (or reject) this intuition.
Model mean donation
mean.formula = mean_donation ~ shares_sc + friends_sc + updates_sc + photos_sc + goal_sc + text_length_words_sc + duration_float_sc + cancer_type + month + day_of_week + (1|year)
mean.mod = glmer(mean.formula, data = dat.m, family = Gamma(link = "log"))
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0779305
## (tol = 0.001, component 1)
drop1(mean.mod, test="Chisq")
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0707713
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0603187
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0492307
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0681091
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0716196
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0470877
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0482949
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0364948
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.013786
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0487506
## (tol = 0.001, component 1)
## Single term deletions
##
## Model:
## mean_donation ~ shares_sc + friends_sc + updates_sc + photos_sc +
## goal_sc + text_length_words_sc + duration_float_sc + cancer_type +
## month + day_of_week + (1 | year)
## Df AIC LRT Pr(Chi)
## <none> 52853
## shares_sc 1 52910 58.920 1.643e-14 ***
## friends_sc 1 52903 52.754 3.780e-13 ***
## updates_sc 1 52865 14.697 0.0001263 ***
## photos_sc 1 52853 2.691 0.1009392
## goal_sc 1 53105 254.324 < 2.2e-16 ***
## text_length_words_sc 1 52867 15.893 6.703e-05 ***
## duration_float_sc 1 52851 0.007 0.9348693
## cancer_type 19 52889 74.587 1.564e-08 ***
## month 11 52850 19.666 0.0501381 .
## day_of_week 6 52848 7.521 0.2753432
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mean.formula = update(mean.formula, ~ . - duration_float_sc)
drop1(glmer(mean.formula, data = dat.m, family = Gamma(link = "log")), test="Chisq")
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0482949
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0446488
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0326906
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0576884
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0499333
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0567112
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0487179
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00549489
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00191435
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0455086
## (tol = 0.001, component 1)
## Single term deletions
##
## Model:
## mean_donation ~ shares_sc + friends_sc + updates_sc + photos_sc +
## goal_sc + text_length_words_sc + cancer_type + month + day_of_week +
## (1 | year)
## Df AIC LRT Pr(Chi)
## <none> 52851
## shares_sc 1 52908 58.917 1.644e-14 ***
## friends_sc 1 52901 52.744 3.801e-13 ***
## updates_sc 1 52864 14.909 0.0001128 ***
## photos_sc 1 52851 2.710 0.0997389 .
## goal_sc 1 53103 254.322 < 2.2e-16 ***
## text_length_words_sc 1 52865 15.910 6.642e-05 ***
## cancer_type 19 52887 74.727 1.480e-08 ***
## month 11 52848 19.733 0.0491457 *
## day_of_week 6 52846 7.507 0.2764528
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mean.formula = update(mean.formula, ~ . - day_of_week)
drop1(glmer(mean.formula, data = dat.m, family = Gamma(link = "log")), test="Chisq")
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0455086
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0302281
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0338187
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0608278
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0273769
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0401886
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0353224
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00344377
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00150837
## (tol = 0.001, component 1)
## Single term deletions
##
## Model:
## mean_donation ~ shares_sc + friends_sc + updates_sc + photos_sc +
## goal_sc + text_length_words_sc + cancer_type + month + (1 |
## year)
## Df AIC LRT Pr(Chi)
## <none> 52846
## shares_sc 1 52904 59.653 1.131e-14 ***
## friends_sc 1 52896 52.149 5.144e-13 ***
## updates_sc 1 52859 15.118 0.000101 ***
## photos_sc 1 52847 2.937 0.086566 .
## goal_sc 1 53097 253.317 < 2.2e-16 ***
## text_length_words_sc 1 52860 15.898 6.684e-05 ***
## cancer_type 19 52882 74.317 1.737e-08 ***
## month 11 52844 20.302 0.041362 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mean.formula = update(mean.formula, ~ . - photos_sc)
drop1(glmer(mean.formula, data = dat.m, family = Gamma(link = "log")), test="Chisq")
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0273769
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0277174
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0486968
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0518222
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0411094
## (tol = 0.001, component 1)
## Warning in (function (fn, par, lower = rep.int(-Inf, n), upper =
## rep.int(Inf, : failure to converge in 10000 evaluations
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.0159764
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00188271
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00122667
## (tol = 0.001, component 1)
## Single term deletions
##
## Model:
## mean_donation ~ shares_sc + friends_sc + updates_sc + goal_sc +
## text_length_words_sc + cancer_type + month + (1 | year)
## Df AIC LRT Pr(Chi)
## <none> 52847
## shares_sc 1 52905 59.823 1.038e-14 ***
## friends_sc 1 52898 52.487 4.332e-13 ***
## updates_sc 1 52858 12.834 0.0003403 ***
## goal_sc 1 53096 250.465 < 2.2e-16 ***
## text_length_words_sc 1 52859 14.129 0.0001707 ***
## cancer_type 19 52884 75.208 1.227e-08 ***
## month 11 52845 19.609 0.0509983 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mean.formula = update(mean.formula, ~ . - month)
drop1(glmer(mean.formula, data = dat.m, family = Gamma(link = "log")), test="Chisq")
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00122667
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00140763
## (tol = 0.001, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00128215
## (tol = 0.001, component 1)
## Single term deletions
##
## Model:
## mean_donation ~ shares_sc + friends_sc + updates_sc + goal_sc +
## text_length_words_sc + cancer_type + (1 | year)
## Df AIC LRT Pr(Chi)
## <none> 52845
## shares_sc 1 52901 58.695 1.841e-14 ***
## friends_sc 1 52895 52.287 4.796e-13 ***
## updates_sc 1 52854 11.739 0.0006119 ***
## goal_sc 1 53091 248.482 < 2.2e-16 ***
## text_length_words_sc 1 52857 14.259 0.0001593 ***
## cancer_type 19 52882 75.322 1.174e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mean.mod = glmer(mean.formula, data = dat.m, family = Gamma(link = "log"))
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl =
## control$checkConv, : Model failed to converge with max|grad| = 0.00122667
## (tol = 0.001, component 1)
summary(mean.mod)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: Gamma ( log )
## Formula: mean_donation ~ shares_sc + friends_sc + updates_sc + goal_sc +
## text_length_words_sc + cancer_type + (1 | year)
## Data: dat.m
##
## AIC BIC logLik deviance df.resid
## 52844.7 53021.8 -26395.3 52790.7 5185
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.9367 -0.6379 -0.1784 0.3914 9.8292
##
## Random effects:
## Groups Name Variance Std.Dev.
## year (Intercept) 0.001385 0.03722
## Residual 0.237275 0.48711
## Number of obs: 5212, groups: year, 7
##
## Fixed effects:
## Estimate Std. Error t value Pr(>|z|)
## (Intercept) 4.557519 0.033615 135.581 < 2e-16 ***
## shares_sc -0.054571 0.006445 -8.467 < 2e-16 ***
## friends_sc -0.046001 0.006203 -7.416 1.2e-13 ***
## updates_sc 0.024870 0.007371 3.374 0.000741 ***
## goal_sc 0.117933 0.008025 14.696 < 2e-16 ***
## text_length_words_sc 0.024569 0.006597 3.725 0.000196 ***
## cancer_typebone cancer -0.132080 0.034109 -3.872 0.000108 ***
## cancer_typebrain cancer -0.047847 0.037123 -1.289 0.197439
## cancer_typebreast cancer -0.059081 0.029870 -1.978 0.047936 *
## cancer_typecervical cancer -0.142279 0.068179 -2.087 0.036901 *
## cancer_typecolon cancer -0.098172 0.064305 -1.527 0.126843
## cancer_typeesophageal cancer 0.016594 0.040043 0.414 0.678585
## cancer_typegeneral -0.076316 0.028674 -2.661 0.007780 **
## cancer_typekidney cancer -0.048947 0.033722 -1.451 0.146646
## cancer_typeleukemia -0.044285 0.038584 -1.148 0.251069
## cancer_typeliver cancer -0.041028 0.045938 -0.893 0.371794
## cancer_typelung cancer 0.036893 0.031975 1.154 0.248580
## cancer_typelymphoma -0.101718 0.031182 -3.262 0.001106 **
## cancer_typemelanoma 0.033878 0.041833 0.810 0.418024
## cancer_typemixed -0.020183 0.030443 -0.663 0.507337
## cancer_typeneuroblastoma -0.063230 0.053805 -1.175 0.239927
## cancer_typepancreatic cancer -0.028213 0.080955 -0.349 0.727462
## cancer_typeprostate cancer 0.261529 0.075629 3.458 0.000544 ***
## cancer_typeskin cancer -0.061921 0.038340 -1.615 0.106298
## cancer_typetesticular cancer -0.122210 0.058088 -2.104 0.035389 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 25 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
## convergence code: 0
## Model failed to converge with max|grad| = 0.00122667 (tol = 0.001, component 1)
lmer produces AIC of 54710, with shares_sc + friends_sc + updates_sc + goal_sc + text_length_words_sc + cancer_type + (1 | year)